*This code reproduces the analyses of the experiment on voters. 
*Running the code produces a set of figures that are saved in the working directory


clear
use voters_experiment

*TABLE 2
reg number treatment secondlist, r
reg number treatment if secondlist==0, r
reg number treatment if secondlist==1, r

*TABLE 4
reg number treatment treatmentXleftparty leftparty secondlist, r
reg number treatment treatmentXleftparty leftparty if secondlist==0, r
reg number treatment treatmentXleftparty leftparty if secondlist==1, r

*TABLE A2
su treatment male university age west north leftparty if secondlist==0 & number!=.
su treatment male university age west north leftparty if secondlist==1 & number!=.

*TABLE A3 (columns 2-3)
reg treatment male university age west north leftparty if secondlist==0, r
testparm male university age west north leftparty
reg treatment male university age west north leftparty if secondlist==1, r
testparm male university age west north leftparty

*TABLE A4
reg missing treatment if secondlist==0, r
reg missing treatment if secondlist==1, r

*FIGURE A5
reg number treated secondlist, r  
coefplot, keep(treated) title("Pooled", color(black) size(medsmall) ) coeflab(treated = "Treatment effect") color(black) graphregion(color(gs16)) ciopts(color(black)) plotregion(style(none)) vertical  ylab(, angle(0) nogrid)
graph save Graph "treatment_pooled.gph", replace

reg number treated if secondlist==0, r 
coefplot, keep(treated control) title("First experiment", color(black) size(medsmall) ) coeflab(treated = "Treatment effect") color(black) graphregion(color(gs16)) ciopts(color(black)) plotregion(style(none)) vertical  ylab(, angle(0) nogrid)
graph save Graph "treatment_firstlist.gph", replace

reg number treated  if secondlist==1, r 
coefplot, keep(treated control) title("Second experiment", color(black) size(medsmall) ) coeflab(treated = "Treatment effect" control = "Control") color(black) graphregion(color(gs16)) ciopts(color(black)) plotregion(style(none)) vertical  ylab(, angle(0) nogrid)
graph save Graph "treatment_secondlist.gph", replace

graph combine  "treatment_pooled.gph" "treatment_firstlist.gph" "treatment_secondlist.gph", rows(1)  graphregion(color(gs16)) ycommon

*TABLE A10
reg number treatment secondlist [pweight=vekt], r
reg number treatment treatXsecondlistc secondlistc [pweight=vekt], r
reg number treatment [pweight=vekt] if secondlist==0, r
reg number treatment [pweight=vekt] if secondlist==1, r

*TABLE A13
reg number treatment treatmentXleftparty leftparty secondlist [pweight=vekt], r
reg number treatment  treatmentXleftparty leftparty treatcXsecondlistc secondlistc treatcXmalec malec treatcXagec agec treatcXuniversityc universityc treatcXnorthc northc treatcXwestc westc secXleftpartyc secXmalec secXagec secXuniversityc secXnorthc secXwestc, r

